using System.Configuration;

namespace TfsSpam.Differ.Configuration
{
    /// <summary>
    /// The DiffConfig class contains the information about how much information
    /// to include when providing detailed information about a file in the changeset
    /// XML document.
    /// </summary>
    /// <remarks>
    /// This element can be left out of the configuration file since defaults are
    /// provided.
    /// </remarks>
    public class DiffConfig : ConfigurationSection
    {
        #region -- Public properties
        /// <summary>
        /// The number of lines of text to include before and after
        /// a change in a file.
        /// </summary>
        /// <remarks>
        /// By default, 5 lines of text are included above and below each change in the file.
        /// </remarks>
        [ConfigurationProperty( "contextLines", IsRequired = false, DefaultValue = 5 )]
        public int ContextLines
        {
            get { return (int) base[ "contextLines" ]; }
        }

        /// <summary>
        /// The maximum number of files included from each file.
        /// </summary>
        /// <remarks>
        /// By default, up to 1000 lines of text are included from a file.
        /// </remarks>
        [ConfigurationProperty( "maxLines", IsRequired = false, DefaultValue = 1000 )]
        public int MaxLines
        {
            get { return (int) base[ "maxLines" ]; }
        }

        /// <summary>
        /// The maximum number of files that will be processed in a changeset.
        /// </summary>
        [ConfigurationProperty( "maxFiles", IsRequired = false, DefaultValue = 20 )]
        public int MaxFiles
        {
            get { return (int) base[ "maxFiles" ]; }
        }
        #endregion
    }
}
